<?php $f = BlogFormatter::getInstance() ?>
<div class="post">
	<h2 class="post-title"><?php echo $data->title ?>
		<?php if (!Yii::app()->user->isGuest): ?>
		<a href="<?php echo $this->createUrl('editPost', array('id'=>$data->id)) ?>" class="edit-btn"><i class="icon-edit icon-white"></i></a>
		<?php endif ?>
	</h2>
	<p class="date pull-left"><?php echo $f->formatDate($data->updated_time) ?></p>
	<p class="rating pull-right">
		<?php for($i=0; $i<Yii::app()->params['maxRating']; $i++): ?>
			<?php if ($i+1<=$data->rating): ?>
			<img src="<?php echo Yii::app()->theme->baseUrl ?>/img/rating-on.png" alt="" />
			<?php else: ?>
			<img src="<?php echo Yii::app()->theme->baseUrl ?>/img/rating-off.png" alt="" />
			<?php endif ?>
		<?php endfor ?>
	</p>
	<div class="clearfix"></div>
	
	<div class="post-content">
		<?php echo $f->processPostContent($data->content) ?>
	</div>
</div>
